using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using DTO;

namespace DAO
{
   public  class LyDoThanhLyDAO
    {
       public List<LyDoThanhLyDTO > _laydslydothanhly_DAO()
       {
           List<LyDoThanhLyDTO > list = new List<LyDoThanhLyDTO >();
           string sql = "select * from LyDoThanhLy";
           DataTable dt = DataProvider.ExcuteQuery(sql);
           if (dt.Rows.Count > 0)
           {
               for (int i = 0; i < dt.Rows.Count; i++)
               {
                   DataRow dr = dt.Rows[i];

                   int malydothanhly = int.Parse(dr["MaLyDoThanhLy"].ToString());
                   string tenlydothanhly = dr["TenLyDoThanhLy"].ToString();

                   LyDoThanhLyDTO ldtl = new LyDoThanhLyDTO();
                   ldtl.Malydothanhly = malydothanhly;
                   ldtl.Tenlydothanhly = tenlydothanhly;
                   list.Add(ldtl);
               }
           }
           return list;
       }

       public static DataTable LayDSLyDo_DAO()
       {
           DataTable dt = new DataTable();
           string sql = "select*from LyDoThanhLy";
           dt = DataProvider.ExcuteQuery(sql);
           return dt;
       }
    }
}
